package com.fbli.controller;

import com.fbli.entity.PageResult;
import com.fbli.pojo.Question;
import com.fbli.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/question")
public class QuestionController {
    @Autowired
    QuestionService questionService;
    @RequestMapping("/selectAll")
    List<Question> selectAll(){
        List<Question> questions = questionService.selectAll();

        return questions;
    }
    @RequestMapping("/selectPage")
    PageResult selectPage(@RequestParam int page,@RequestParam int rows){
        return questionService.selectPage(page, rows);
    }
}
